package zhr.chapter12;

import java.util.Stack;

public class Example12_6{
    public static void main(String[] args) {
        Stack<Integer> myStack=new Stack<>();
        myStack.setSize(3);
        myStack.removeAllElements();
        Thread writeThread=new Thread(new WriteStack(myStack));
        writeThread.setName("WriteThread");
        Thread readThread=new Thread(new ReadStack(myStack));
        readThread.setName("ReadThread");
        writeThread.start();
        readThread.start();
    }

}